package cn.cherish.controller;

import cn.cherish.domain.User;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;

@RestController
public class UserController {

    @Value("${server.port}")
    private int port;

    //订单服务来调用这个方法      http://localhost:1020/user/1
     @GetMapping("/findById/{id}")
    public User getById(@PathVariable("id") Long id){
        //根据id去数据库查询User
        return  new User(id,"zs:" + id,"我是zs。port=" + port);
    }
}
